home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / rsh10 / _setup.1 / TEST.frm < prev    next >
Text File  |  1998-06-01  |  5KB  |  172 lines

  1. VERSION 5.00
  2. Object = "{95C9A3B6-DDF5-11D1-B910-00A0C992A443}#1.0#0"; "RSH.ocx"
  3. Begin VB.Form Form1 
  4.    Caption         =   "Remote Shell Demo Form"
  5.    ClientHeight    =   4365
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   6360
  9.    LinkTopic       =   "Form1"
  10.    LockControls    =   -1  'True
  11.    ScaleHeight     =   4365
  12.    ScaleWidth      =   6360
  13.    StartUpPosition =   3  'Windows Default
  14.    Begin RSH.RemoteShell RemoteShell1 
  15.       Left            =   135
  16.       Top             =   3735
  17.       _ExtentX        =   847
  18.       _ExtentY        =   847
  19.       Async           =   "False"
  20.    End
  21.    Begin VB.TextBox Text5 
  22.       Height          =   330
  23.       IMEMode         =   3  'DISABLE
  24.       Left            =   1170
  25.       PasswordChar    =   "*"
  26.       TabIndex        =   8
  27.       Text            =   "password"
  28.       Top             =   1170
  29.       Width           =   5010
  30.    End
  31.    Begin VB.TextBox Text4 
  32.       Height          =   330
  33.       Left            =   1170
  34.       TabIndex        =   6
  35.       Text            =   "user"
  36.       Top             =   810
  37.       Width           =   5010
  38.    End
  39.    Begin VB.TextBox Text3 
  40.       Height          =   330
  41.       Left            =   1170
  42.       TabIndex        =   4
  43.       Text            =   "192.168.0.1"
  44.       Top             =   450
  45.       Width           =   5010
  46.    End
  47.    Begin VB.TextBox Text2 
  48.       Height          =   330
  49.       Left            =   1170
  50.       TabIndex        =   2
  51.       Text            =   "ls -l"
  52.       Top             =   90
  53.       Width           =   5010
  54.    End
  55.    Begin VB.TextBox Text1 
  56.       Height          =   1995
  57.       Left            =   1170
  58.       MultiLine       =   -1  'True
  59.       ScrollBars      =   2  'Vertical
  60.       TabIndex        =   1
  61.       Top             =   1575
  62.       Width           =   5010
  63.    End
  64.    Begin VB.CommandButton Command1 
  65.       Caption         =   "Execute"
  66.       Height          =   555
  67.       Left            =   4185
  68.       TabIndex        =   0
  69.       Top             =   3690
  70.       Width           =   1995
  71.    End
  72.    Begin VB.Label Label5 
  73.       Caption         =   "Response:"
  74.       Height          =   285
  75.       Left            =   90
  76.       TabIndex        =   10
  77.       Top             =   1665
  78.       Width           =   1140
  79.    End
  80.    Begin VB.Label Label4 
  81.       Caption         =   "Password:"
  82.       Height          =   285
  83.       Left            =   90
  84.       TabIndex        =   9
  85.       Top             =   1215
  86.       Width           =   1140
  87.    End
  88.    Begin VB.Label Label3 
  89.       Caption         =   "Username:"
  90.       Height          =   285
  91.       Left            =   90
  92.       TabIndex        =   7
  93.       Top             =   855
  94.       Width           =   1140
  95.    End
  96.    Begin VB.Label Label2 
  97.       Caption         =   "Host:"
  98.       Height          =   285
  99.       Left            =   90
  100.       TabIndex        =   5
  101.       Top             =   495
  102.       Width           =   1140
  103.    End
  104.    Begin VB.Label Label1 
  105.       Caption         =   "Command:"
  106.       Height          =   285
  107.       Left            =   90
  108.       TabIndex        =   3
  109.       Top             =   135
  110.       Width           =   1140
  111.    End
  112. End
  113. Attribute VB_Name = "Form1"
  114. Attribute VB_GlobalNameSpace = False
  115. Attribute VB_Creatable = False
  116. Attribute VB_PredeclaredId = True
  117. Attribute VB_Exposed = False
  118. '********************************************************************************
  119. '* Module: Form1
  120. '* Author: Greg Laycock
  121. '* Description:
  122. '*
  123. '********************************************************************************
  124. '* Revision:
  125. '*
  126. '********************************************************************************
  127. Option Explicit
  128.  
  129. '********************************************************************************
  130. '* Procedure: Command1_Click
  131. '* Author: Greg Laycock
  132. '* Description:
  133. '*  Execute Command
  134. '********************************************************************************
  135. Private Sub Command1_Click()
  136.     RemoteShell1.Host = Text3.Text
  137.     RemoteShell1.UserName = Text4.Text
  138.     RemoteShell1.Password = Text5.Text
  139.     RemoteShell1.Command = Text2.Text
  140.     Call RemoteShell1.Process
  141. End Sub
  142.  
  143. '********************************************************************************
  144. '* Procedure: RemoteShell1_AsyncComplete
  145. '* Author: Greg Laycock
  146. '* Description:
  147. '*  Async Complete Message
  148. '********************************************************************************
  149. Private Sub RemoteShell1_AsyncComplete()
  150.     MsgBox "Complete!"
  151. End Sub
  152.  
  153. '********************************************************************************
  154. '* Procedure: RemoteShell1_Error
  155. '* Author: Greg Laycock
  156. '* Description:
  157. '*  Connection Error Event
  158. '********************************************************************************
  159. Private Sub RemoteShell1_Error(ByVal ErrorNumber As String, ByVal ErrorText As String)
  160.     Text1.Text = ErrorNumber & "-" & ErrorText
  161. End Sub
  162.  
  163. '********************************************************************************
  164. '* Procedure: RemoteShell1_ReceiveData
  165. '* Author: Greg Laycock
  166. '* Description:
  167. '*  Receive Data Event
  168. '********************************************************************************
  169. Private Sub RemoteShell1_ReceiveData(ByVal InData As String)
  170.     Text1.Text = Text1.Text & InData
  171. End Sub
  172.